<?php


namespace dsp\proxy;


class Main extends \kernel\BaseMain
{

    protected function clientCode(Subject $subject)
    {
        $subject->request();
    }

    public function execute($choice = 'all')
    {
        echo "Client: Executing the client code with a real subject:\n";
        $realSubject = new RealSubject();
        $this->clientCode($realSubject);

        echo "\n";

        echo "Client: Executing the same client code with a proxy:\n";
        $proxy = new Proxy($realSubject);
        $this->clientCode($proxy);
    }
}